/* Copyright Thanh-Trung Pham, JAIST, 2013 */
package jp.ac.jaist.model.markov;

import java.util.HashSet;
import java.util.Set;

/**
 * @author Thanh-Trung Pham
 */
public class RMPIMarkovState {

    private String m_strTextPart;
    private Set<String> m_oSetPart;
    private Set<RMPIMarkovTransition> m_oOutgoingTransitions;
    private boolean m_bIsAbsorbing;
    private int m_iID;

    /**
     * The constructor.
     *
     * @param textPart    the text part.
     * @param setPart     the set part.
     * @param isAbsorbing true if this state is absorbing, otherwise, false.
     */
    public RMPIMarkovState(String textPart, Set<String> setPart, boolean isAbsorbing) {
        m_strTextPart = textPart;
        m_oSetPart = setPart;
        m_bIsAbsorbing = isAbsorbing;

        m_iID = -1;

        m_oOutgoingTransitions = new HashSet<RMPIMarkovTransition>();
    }

    /**
     * Get all outgoing transition.
     *
     * @return all outgoing transition.
     */
    public Set<RMPIMarkovTransition> getOutgoingTransitions() {
        return m_oOutgoingTransitions;
    }

    /**
     * Add an outgoing transition.
     *
     * @param transition the outgoing transition
     */
    public void addOutgoingTransition(RMPIMarkovTransition transition) {
        m_oOutgoingTransitions.add(transition);
    }

    /**
     * Get the set part.
     *
     * @return the set part.
     */
    public Set<String> getSetPart() {
        return m_oSetPart;
    }

    /**
     * Get the text part.
     *
     * @return the text part.
     */
    public String getTextPart() {
        return m_strTextPart;
    }

    /**
     * Check if this state is absorbing.
     *
     * @return true if this state is absorbing, otherwise, false.
     */
    public boolean isAbsorbing() {
        return m_bIsAbsorbing;
    }

    /**
     * Get the state ID.
     *
     * @return the state ID.
     */
    public int getID() {
        return m_iID;
    }

    /**
     * Set the state id.
     *
     * @param id the state id.
     */
    public void setID(int id) {
        m_iID = id;
    }
}
